package com.shouren.args.type;

public abstract class BaseArgs<T> {

    protected String valueStr;
    private T data;
    private T defaultData;

    public BaseArgs(String valueStr, T defaultData) {
        this.valueStr = valueStr;
        data = parse();
        this.defaultData = defaultData;
    }

    public T getData() {
        return data != null ? data : defaultData;
    }

    public abstract T parse();

}
